<%@page import="com.mconnect.msurvey.model.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@ taglib prefix="s" uri="/struts-tags"%>
 <%
// w celu poprawnie dzialajacej sesji:
response.setHeader("Cache-Control","no-store"); 
response.setHeader("Pragma","no-cache"); 
response.setDateHeader ("Expires", 0); 
%>     
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
	  <title>Panel Admina</title>
	  <link rel="stylesheet" href="resources/css/ap.css">
	  <link rel="stylesheet" href="js/jQuery/demos.css">
	  <link rel="stylesheet" href="js/jQuery/themes/base/jquery.ui.all.css">
	  
	<script src="js/jQuery/jquery-1.8.2.js"></script>
	<script src="js/jQuery/ui/jquery.ui.core.js"></script>
	<script src="js/jQuery/ui/jquery.ui.widget.js"></script>
	<script src="js/jQuery/ui/jquery.ui.position.js"></script>
	<script src="js/jquery.validate.js" type="text/javascript"></script>
	<script src="js/messages_pl.js" type="text/javascript"></script>
	
 
	  <style type="text/css">
	  	.errorMessage{
	  		color: red;
	  		font-style: italic;
	  	}
	  	
	  	.formularz FIELDSET { border: none; }
		.formularz LEGEND   { font-size: 1.5em; font-weight: bold; margin: 0; padding: 0 0 8px 0; text-decoration: underline; }
 
		.formularz LABEL        { color: #C02942; display: block; font-size: 1.1em; font-weight: bold; margin: 0 5px 0 0; padding: 0 0 5px 0;  }
		.formularz LABEL.error  { background: #ECD078; color: #C02942; margin: 5px 0 10px 0; padding: 3px; width: 200px; }
 
		.formularz INPUT,
		.formularz TEXTAREA       { border: 1px solid #542437; color: #542437; font-family: Arial, Helvetica, sans-serif; font-size: 1.1em; padding: 2px; width: 190px; }
		.formularz INPUT:focus,
		.formularz TEXTAREA:focus { border: 1px solid #53777A; }
 
		.formularz INPUT[type=submit] { background: #53777A; border: 1px solid
	  	
	  </style>
	  
	  <script>
		$(function() {
			
			jQuery(document).ready(function(){
			    jQuery("#form1").validate();
			  });
		});
	</script>
  </head>
	
<body>
<div id="top">
   
    <div class="sessionUser">
    	<div id="logoMconnect">
    		<img src="resources/images/top_logo.gif" width="84" height="59" alt="image001"/>
    	</div>
    	<div id="mConnect_txt">
        	mConnect<br/>al. Jana Pawła II 41c<br/>31-864 Kraków
       </div>
    	
	     <% User admin = (User)session.getAttribute("admin"); 
			if(admin == null){ %>
				<jsp:forward page="loginAdminForm.jsp"></jsp:forward>
		<%}%>
    </div>
    <img src="resources/images/kreska.png" class="kreska">
    <div class="header_txt">
     <a href="adminPanel.jsp" style="text-decoration: none;">
     		<p class="header_txt_1">mSurvey</p>
      		<p class="header_txt_2">Panel Administratora</p>
      	</a>
    </div>
    <ul id=menu>
      
    <li><s:a action="goToSearchSurvey"> Wyszukaj ankietę </s:a></li>
	<li><s:a action="goToCampaigns">Kampanie</s:a></li>
	<li><s:a action="goToRegisterUser">+Dodaj ankietera+</s:a></li>
	<li><s:a action="goToConfirmList">Potwierdziły przybycie</s:a></li>
	<li><s:a action="goToReports">Raporty</s:a></li>
	<li style="float: right"><s:a action="logoutAdmin">Wyloguj</s:a></li>
    </ul>
    
    <div id=kategorie>
    	<% String message = request.getParameter("message");
      		if(message != null){%>
	      		<div style="float: left; width: 90%; margin-left:5%; background-color: #006633; color: white; text-align: center;">
					
						<h1><%= message %></h1>
						
				</div>
			<%} %> 
				<br><br />
	    <h1 style="text-align: center;">Dodaj nowego ankietera</h1>
		<br /><br />
		<center>
		<form action="registerUser" method="post" id="form1" class="formularz">
			<table style="font-size: 15px;">
				<tr>
					<td><s:textfield name="user.login" label="Login" id="login" cssClass="required" minlength="5" /></td>
				</tr>
				<tr>
					<td><s:textfield name="user.pass" label="Hasło" id="pass" cssClass="required" minlength="5" /></td>
					
				</tr>
				<tr>
					<td><s:textfield name="user.firstname" label="Imie" id="firstname" cssClass="required"/></td>
				</tr>
				<tr>
					<td><s:textfield name="user.lastname" label="Nazwisko" id="lastname" cssClass="required" /></td>
				</tr>
				<tr>
					<td colspan="2">&nbsp</td>
				</tr>
				<tr>
					<td colspan="2" align="center"><input type="submit" value="Zapisz"  style="width: 120px; height: 30px; background-color: #e6e6e6; " /></td>
				</tr>
			</table>
		</form>
		</center>
    </div>
</div>
  </body>
</html>